#include "LuaLink_Widget.h"

LuaLink_Widget::LuaLink_Widget(MyGUI::Widget* widget) {
	mWidget = widget;
}

LuaLink_Widget::~LuaLink_Widget(void) {
}

void LuaLink_Widget::lua_setPosition(int left, int top) {
	mWidget->setPosition(left, top);
}

void LuaLink_Widget::lua_setSize(int left, int top)  {
	mWidget->setSize(left, top);
}

void LuaLink_Widget::lua_show() {
	mWidget->setVisible(true);
}

void LuaLink_Widget::lua_hide() {
	mWidget->setVisible(false);
}

void LuaLink_Widget::lua_setCaption(const char* caption) {
	std::string str = caption;
	mWidget->setCaption(str);
}

const Ogre::String& LuaLink_Widget::lua_getCaption() {
	return mWidget->getCaption();
}

void LuaLink_Widget::lua_setAlpha(float alpha) {
	mWidget->setAlpha(alpha);
}

float LuaLink_Widget::lua_getAlpha() {
	return mWidget->getAlpha();
}

LuaLink_Widget* LuaLink_Widget::lua_getParent() {
	return new LuaLink_Widget(mWidget->getParent());
}

void LuaLink_Widget::lua_onEventMouseLostFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseLostFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseSetFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseSetFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseDrag(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseDrag = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseMove(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseMove = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseWheel(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseWheel = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseButtonPressed(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseButtonPressed = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseButtonReleased(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseButtonReleased = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventMouseButtonClick(luabind::object func) {
	if (func) {
		LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
		mWidget->eventMouseButtonClick = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	}
}

void LuaLink_Widget::lua_onEventMouseButtonDoubleClick(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventMouseButtonDoubleClick = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventKeyLostFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventKeyLostFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventKeySetFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventKeySetFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventKeyButtonPressed(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventKeyButtonPressed = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventKeyButtonReleased(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventKeyButtonReleased = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventRootMouseChangeFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventRootMouseChangeFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventRootKeyChangeFocus(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventRootKeyChangeFocus = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventActionInfo(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventActionInfo = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onRequestGetContainer(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->requestGetContainer = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}

void LuaLink_Widget::lua_onEventToolTip(luabind::object func) {
	//if (func) {
	//	LuaLink_Widget_Delegate* wDelegate = new LuaLink_Widget_Delegate(func);
	//	mWidget->eventToolTip = MyGUI::newDelegate(wDelegate, &LuaLink_Widget_Delegate::executeEvent);
	//}
}
